<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <!-- layui中的核心css文件 -->
  <link rel="stylesheet" href="layui-v2.5.7/layui/css/layui.css">
  <!-- swiper的核心css文件 -->
  <link rel="stylesheet" href="swiper/css/swiper.css">
  <!-- 自己的css文件 -->
  <!-- <link rel="stylesheet" href=""> -->
  <!-- 数据文件 -->
  <script src="dataJs/data.js"></script>
  <!-- layui中的核心js文件 -->
  <script src="layui-v2.5.7/layui/layui.js"></script>
  <!-- swiper的核心js文件 -->
  <script src="swiper/js/swiper.js"></script>
  <!-- jquery库文件 -->
  <script src="jquery/jquery 1.11.0/jquery-1.11.0.js"></script>
  <!-- 自己的js文件 -->
  <!-- <script src=""></script> -->
  <style>
    #main {
      width: 100%;
      height: 95%;
    }

    #frame {
      width: 100%;
      height: 99%;
      /* border: 1px solid red; */
      box-sizing: border-box;
    }

  </style>
  <script>
    $(function () {
      var users = JSON.parse(localStorage.getItem("users"));
      var index = localStorage.getItem("index");

      $("#topName").html(users[index].username);

    })
    function doExit(){
      localStorage.setItem("index", "")
    }
  </script>
</head>

<body>
  <div class="layui-layout layui-layout-admin">
    <div class="layui-header">
      <div class="layui-logo">图书馆后台布局</div>
      <ul class="layui-nav layui-layout-right">
        <li class="layui-nav-item">
          <a href="javascript:;" id="topName" >
          </a>
        </li>
        <li class="layui-nav-item" onclick="doExit()"><a href="./login.html">退出</a></li>
      </ul>
    </div>

    <div class="layui-side layui-bg-black">
      <div class="layui-side-scroll">
        <ul class="layui-nav layui-nav-tree" lay-filter="test">
          <li class="layui-nav-item layui-nav-itemed">
            <a class="" href="javascript:;">用户管理</a>
            <dl class="layui-nav-child">
              <dd><a href="./guanli.html" target="body">后台用户</a></dd>
            </dl>
          </li>
          <li class="layui-nav-item">
            <a href="javascript:;">图书管理</a>
            <dl class="layui-nav-child">
              <dd><a href="./BookAdd.html" target="body">图书添加</a></dd>
              <dd><a href="./BookSearch.html" target="body">图书查询</a></dd>
              <dd><a href="./hotbooks.html" target="body">热销书展示</a></dd>
            </dl>
          </li>
        </ul>
      </div>
    </div>

    <div class="layui-body">
      <!-- 内容主体区域 -->
      <div style="width:100%;height:100%;
      padding: 0px;margin-bottom: 0 ;" id="main">
        <iframe src="./guanli.html" id="frame" name="body"></iframe>

      </div>
    </div>

    <div class="layui-footer" style="margin-top: 0;padding-top: 0;">
      <!-- 底部固定区域 -->
      © layui.com - 底部固定区域
    </div>
  </div>

  <script>
    //JavaScript代码区域
    layui.use('element', function () {
      var element = layui.element;

    });
  </script>
</body>

</html>